 #!/bin/bash


exec() {

 echo "[global]
timeout = 6000

index-url = https://pypi.tuna.tsinghua.edu.cn/simple

trusted-host = pypi.tuna.tsinghua.edu.cn" > ~/.pip/pip.conf

}

echo "$HOME"
if [ -d "$HOME/.pip" ]; then
 echo "存在.pip目录"
 if [ -f "$HOME/.pip/pip.conf" ]; then
    echo "存在pip.conf文件，是否重置conf文件"；
    read  -p  "存在pip.conf文件，是否重置conf文件,请输入y/n" flag
    if [ $flag = "y" ]; then
   exec; 
    fi
 fi    
else
 echo "1"
 #新建.pip目录
 mkdir ~/.pip;
 exec;
fi